package com.bjsxt.mapper;

import com.bjsxt.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    //获取当前用户的权限信息
    @Select("select pinfo from t_power where pid in(select pid from t_role_power where rid in(select rid from t_user_role where uid in(select uid from t_user where uname=#{uname}) ))")
    List<String> selPowerInfoMapper(@Param("uname") String uname);

    //获取当前用户的角色信息
    @Select("select rname from t_role where rid in( select rid from t_user_role where uid in(select uid from t_user where uname=#{uname}))")
    List<String> selRoleInfoMapper(@Param("uname") String uname);

    //根据用户名获取用户信息
    @Select("select * from t_user where uname=#{uname}")
    User selUserInfoMapper(@Param("uname") String uname);
}
